home *** CD-ROM | disk | FTP | other *** search
- Path: tekram.com.tw!not-for-mail
- From: stkuo@tekram.com.tw (Shih Tung Kuo)
- Newsgroups: comp.lang.c++
- Subject: VB and DLL program
- Date: 19 Apr 1996 10:58:15 +0800
- Organization: I need to put my ORGANIZATION here.
- Message-ID: <4l6vg7$3mq@tekram.com.tw>
- NNTP-Posting-Host: tekram.hinet.net
- NNTP-Posting-User: stkuo
- X-Newsreader: TIN [version 1.2 PL2]
-
-
- Dear sir :
-
- We have an application that is programmed using VB3 and calls a lot of
- DLL programmed using VC++. This application will work in the Novell Network.
- Now, we have a problem when we call a function in DLL from VB3. The following
- is the fragment of our DLL function :
-
- :
- :
- int EXPORT_API NPInitialize(InitHandle ** userHandle, unsigned long uID)
- {
- *userHandle = NULL;
- InitHandle *localHandle = new InitHandle;
- if (!localHandle)
- return ERROR_CODE(NPER_OUT_OF_MEMORY);
- :
- :
- }
-
- When we call the function NPInitialize() from VB3, it generates a GERNERAL
- PROTECTION FAULT message when it executes the following statement :
-
- InitHandle *localHandle = new InitHandle;
-
- If we trace the program in assembly mode, this problem is occurred in a function
- called ??2@ZAPEXI@Z. I think this funtion is the run-time function of "new".
-
- How can we solve this problem? Does it produce by VB? Does the VB program
- corruped the heap of the C++ code? We will appreciate your help. Please send
- your solution by sending to our E-mail address. Our E-mail address is
- stkuo@tekram.com.tw.
-
-
- Thanks a lot.
-
- KUO
-
-
-